Math for Assembly

Submit this sheet with all calculations and all supporting work.

  1. Convert the following decimal numbers to binary:
(a) 1252125÷2 remainder 162÷2 remainder 031÷2 remainder 115÷2 remainder 17÷2 remainder 13÷2 remainder 11÷2 remainder 1Note:26+25+24+23+22+2064+32+16+8+4+1=125125 in binary form is 111 1101(b) 42242÷2 remainder 021÷2 remainder 110÷2 remainder 05÷2 remainder 12÷2 remainder 01÷2 remainder 1Note:25+23+2132+8+2=12542 in binary form is 10 1010 \begin{aligned} \textrm{\textcolor{skyblue}{(a) 125}}\qquad &\\ 2&\sqrt{125} & \div2\ remainder\ 1\\ &62 & \div2\ remainder\ 0\\ &31 & \div2\ remainder\ 1\\ &15 & \div2\ remainder\ 1\\ &7 & \div2\ remainder\ 1\\ &3 & \div2\ remainder\ 1\\ &1 & \div2\ remainder\ 1\\ Note: &\quad 2^6 + 2^5 + 2^4 + 2^3 + 2^2 + 2^0 \\ &\quad 64 + 32 + 16 + 8 + 4 + 1 = 125\\ \therefore &\quad\text{\textcolor{khaki}{125 in binary form is 111 1101}}\\[2em] \textrm{\textcolor{skyblue}{(b) 42}}\qquad &\\ 2&\sqrt{42} & \div2\ remainder\ 0\\ &21 & \div2\ remainder\ 1\\ &10 & \div2\ remainder\ 0\\ &5 & \div2\ remainder\ 1\\ &2 & \div2\ remainder\ 0\\ &1 & \div2\ remainder\ 1\\ Note: &\quad 2^5 + 2^3 + 2^1 \\ &\quad 32 + 8 + 2 = 125\\ \therefore &\quad\text{\textcolor{khaki}{42 in binary form is 10 1010}} \end{aligned}
  1. Convert the following binary numbers to decimal:
    (a) 1001 0010 1101 1000
    (b) 1011 1010 1010 1111
2152142132122112102928272625242322212032768163848192409620481024512256128643216842110010010110110002152142132122112102928272625242322212032,768 + 4,096 + 512 + 128 + 64 + 16 + 8 = 37, 5921001 0010 1101 1000 in decimal form is 37, 59210111010101011112152142132122112102928272625242322212032768163848192409620481024512256128643216842132,768 + 8,192 + 4096 + 2048 + 512 + 128 + 32 + 8 + 4 + 2 + 1 = 47, 7911011 1010 1010 1111 in decimal form is 47, 791 \begin{matrix*}[c] 2^{15} & 2^{14} & 2^{13} & 2^{12} & 2^{11} & 2^{10} & 2^9 & 2^8 & 2^7 & 2^6 & 2^5 & 2^4 & 2^3 & 2^2 & 2^1 & 2^0 &\\ 32768 & 16384 & 8192 & 4096 & 2048 & 1024 & 512 & 256 & 128 & 64 & 32 & 16 & 8 & 4 & 2 & 1 &\\\\ 1&0&0&1& 0&0&1&0& 1&1&0&1& 1&0&0&0&\\ 2^{15} & \phantom{ 2^{14} } & \phantom{ 2^{13} } & 2^{12} & \phantom{ 2^{11} } & \phantom{ 2^{10} } & 2^9 & \phantom{ 2^8 } & 2^7 & 2^6 & \phantom{ 2^5 } & 2^4 & 2^3 & \phantom{ 2^2 } & \phantom{ 2^1 } & \phantom{ 2^0 } &\\ \end{matrix*}\\[2em] \textsf{32,768 + 4,096 + 512 + 128 + 64 + 16 + 8 = 37, 592} \\ \therefore \quad\text{\textcolor{khaki}{1001 0010 1101 1000 in decimal form is 37, 592}}\\[2em] \begin{matrix*}[c] 1&0&1&1 &1&0&1&0 &1&0&1&0 &1&1&1&1&\\ 2^{15} & \phantom{ 2^{14} } & 2^{13} & 2^{12} & 2^{11} & \phantom{ 2^{10} } & 2^9 & \phantom{ 2^8 } & 2^7 & \phantom{ 2^6 } & 2^5 & \phantom{ 2^4 } & 2^3 & 2^2 & 2^1 & 2^0 &\\ 32768 & \phantom{ 16384 } & 8192 & 4096 & 2048 & \phantom{ 1024 } & 512 & \phantom{ 256 } & 128 & \phantom{ 64 } & 32 & \phantom{ 16 } & 8 & 4 & 2 & 1 &\\ \end{matrix*}\\[2em] \textsf{32,768 + 8,192 + 4096 + 2048 + 512 + 128 + 32 + 8 + 4 + 2 + 1 = 47, 791} \\ \therefore \quad\text{\textcolor{khaki}{1011 1010 1010 1111 in decimal form is 47, 791}}\\[2em]
  1. Convert the following decimal numbers to hexadecimal:
    (a) 925 ans is D93
    (b) 104
(a) 92516925÷16 remainder 13 or D57÷16 remainder 93÷16 remainder 3Note:162×3+162×9+160×3768+144+3=125925 in hexadecimal form is 39D(b) 10416104÷16 remainder 86÷16 remainder 6Note:161×6+160×896+8=104104 in hexadecimal form is 68 \begin{aligned} \textrm{\textcolor{skyblue}{(a) 925}}\qquad &\\ 16&\sqrt{925} & \div 16\ remainder\ 13\ or\ D\\ &57 & \div 16\ remainder\ 9\\ &3 & \div 16\ remainder\ 3\\ Note: &\quad 16^2\times 3 + 16^2 \times 9 + 16^0 \times 3 \\ &\quad 768 + 144 + 3 = 125\\ \therefore &\quad\text{\textcolor{khaki}{925 in hexadecimal form is 39D}}\\[2em] \textrm{\textcolor{skyblue}{(b) 104}}\qquad &\\ 16&\sqrt{104} & \div16\ remainder\ 8\\ &6 & \div16\ remainder\ 6\\ Note: &\quad 16^1 \times 6 + 16^0 \times 8 \\ &\quad 96 + 8 = 104\\ \therefore &\quad\text{\textcolor{khaki}{104 in hexadecimal form is 68}} \end{aligned}
  1. Convert the following hexadecimal numbers to decimal:
    (a) 0x5F53DA
    (b) 0x54ABC2
(a) 0 x 5F53DA(5F53DA)16=5×165=5,242,880+15×164=983,040+5×163=20,480+3×162=768+13×161=208+10×160=+100 x 5F53DA in decimal form is6,247,386(a) 0 x 54ABC2(54ABC2)16=5×165=5,242,880+4×164=262,144+10×163=40,960+11×162=2,816+12×161=192+2×160=+20 x 54ABC2 in decimal form is5,548,994 \begin{aligned} \textrm{\textcolor{skyblue}{(a) 0 x 5F53DA}}\qquad\qquad&\\ (5F53DA)_{16}=\qquad &5&\times 16^5& =& 5,242,880&\\ +\qquad &15&\times 16^4& =& 983,040&\\ +\qquad &5&\times 16^3& =& 20,480&\\ +\qquad &3&\times 16^2& =& 768&\\ +\qquad &13&\times 16^1& =& 208&\\ +\qquad &10&\times 16^0& =&+\qquad 10&\\ &&&\therefore& \quad\text{\textcolor{khaki}{0 x 5F53DA in decimal form is\qquad $\overline{6,247,386}$}}& \\[2em] \textrm{\textcolor{skyblue}{(a) 0 x 54ABC2}}\qquad\qquad&\\ (54ABC2)_{16}=\qquad &5&\times 16^5& =& 5,242,880&\\ +\qquad &4&\times 16^4& =& 262,144&\\ +\qquad &10&\times 16^3& =& 40,960&\\ +\qquad &11&\times 16^2& =& 2,816&\\ +\qquad &12&\times 16^1& =& 192&\\ +\qquad &2&\times 16^0& =&+\qquad 2&\\ &&&\therefore& \quad\text{\textcolor{khaki}{0 x 54ABC2 in decimal form is\qquad $\overline{5,548,994}$}}& \\[2em] \end{aligned}
  1. Convert the following binary numbers to hexadecimal:
(a) 1011 1000 0001 0000101111B 10008 00011 00000 1011 1000 0001 0000 in hexadecimal is B810(b) 1010 0100 0011 1100101010A 01004 00113 110012C 1010 0100 0011 1100 in hexadecimal is A43C \begin{aligned} \textrm{\textcolor{skyblue}{(a) 1011 1000 0001 0000}}\qquad\qquad&\\[1em] \underbrace{\underbrace{1011}_{\text{11}}}_{\text{B}}\ \underbrace{1000}_{\text{8}}\ \underbrace{0001}_{\text{1}}\ \underbrace{0000}_{\text{0}}\ &\\\\ \therefore\text{\textcolor{khaki}{1011 1000 0001 0000 in hexadecimal is B810}}\\[2em] \textrm{\textcolor{skyblue}{(b) 1010 0100 0011 1100}}\qquad\qquad&\\[1em] \underbrace{ \underbrace{1010}_{\text{10}} }_{\text{A}}\ \underbrace{0100}_{\text{4}}\ \underbrace{0011}_{\text{3}}\ \underbrace{ \underbrace{1100}_{\text{12}} }_{\text{C}}\ &\\\\ \therefore\text{\textcolor{khaki}{1010 0100 0011 1100 in hexadecimal is A43C}} \end{aligned}
Decimal Hexadecimal Binary
0 0 0000
1 1 0001
2 2 0010
3 3 0011
4 4 0100
5 5 0101
6 6 0110
7 7 0111
8 8 1000
9 9 1001
10 A 1010
11 B 1011
12 C 1100
13 D 1101
14 E 1110
15 F 1111
  1. Convert the following hexadecimal numbers to binary:
    (a) 0x5CD6
    (b) 0x2BCD
(a) 0 × 5CD650101 C121100 D131101 60110 × 5CD6 in hexadecimal to binary is 101 1100 1101 0110(b) 0 × 2BCD20010 B111011 C121100 D131101× 2BCD in hexadecimal to binary is 10 1011 1100 1101 \begin{aligned} \textrm{\textcolor{skyblue}{(a) 0 $\times$ 5CD6}}\qquad\qquad&\\[1em] \underbrace{5}_{\text{0101}}\ \underbrace{\underbrace{C}_{\text{12}}}_{\text{1100}}\ \underbrace{\underbrace{D}_{\text{13}}}_{\text{1101}}\ \underbrace{6}_{\text{0110}}\ &\\\\ \therefore\text{\textcolor{khaki}{0 $\times$ 5CD6 in hexadecimal to binary is 101 1100 1101 0110}}\\[2em] \textrm{\textcolor{skyblue}{(b) 0 $\times$ 2BCD}}\qquad\qquad&\\[1em] \underbrace{2}_{\text{0010}}\ \underbrace{ \underbrace{B}_{\text{11}} }_{\text{1011}}\ \underbrace{ \underbrace{C}_{\text{12}} }_{\text{1100}}\ \underbrace{ \underbrace{D}_{\text{13}} }_{\text{1101}}\\\\ \therefore\text{\textcolor{khaki}{0 $\times$ 2BCD in hexadecimal to binary is 10 1011 1100 1101}}\\[2em] \end{aligned}
  1. Calculate the 2’s complement of each of the following numbers:
    (a) 1000 0101
    (b) 1001 1101
(a) 1000 0101( 1’s complement ) 0111 1010+0000 0001( 2’s complement )0111 1011(a) 1001 1101( 1’s complement ) 0110 0010+0000 0001( 2’s complement )0110 0011 \begin{aligned} \textrm{\textcolor{skyblue}{(a) 1000 0101}}\qquad\qquad&\\[1em] \text{( 1's complement ) }\qquad 0111\ 1010&\\ +0000\ 0001&\\ \text{\textcolor{khaki}{( 2's complement )\qquad $\overline{0111\ 1011}$}}& \\[2em] \textrm{\textcolor{skyblue}{(a) 1001 1101}}\qquad\qquad&\\[1em] \text{( 1's complement ) }\qquad 0110\ 0010&\\ +0000\ 0001&\\ \text{\textcolor{khaki}{( 2's complement )\qquad $\overline{0110\ 0011}$}}& \\[2em] \end{aligned}
  1. Perform the following signed operations in binary. Do not convert the numbers.
(a) 1101 1000 + 1000 1100110111 1000+1000 1100 1 0110 0100(b) 1110 1010 – 0010 01001110 10010100010 0100 1100 0110 \begin{aligned} \textrm{\textcolor{skyblue}{(a) 1101 1000 + 1000 1100}}\qquad\qquad&\\[1em] 11\overset{1}{0}\overset{1}{1} \ 1000\\ +\quad1000\ 1100\\ \text{\textcolor{khaki}{ $\overline{1\ 0110\ 0100}$}}& \\[2em] \textrm{\textcolor{skyblue}{(b) 1110 1010 – 0010 0100}}\qquad\qquad&\\[1em] 1110\ \overset{0}{\cancel{1}}\overset{10}{0}10\\ -\quad0010\ 0100\\ \text{\textcolor{khaki}{ $\overline{1100\ 0110}$}}& \\[2em] \end{aligned}
  1. Perform the following signed operations in hexadecimal. Do not convert the numbers.
(a) 0x1F + 0xA911F+A9 C8(b) 0x3B – 0x123B12 29 \begin{aligned} \textrm{\textcolor{skyblue}{(a) 0x1F + 0xA9}}\qquad\qquad&\\[1em] \overset{1}{1}F&\\ +A9&\\ \text{\textcolor{khaki}{ $\overline{C8}$}}& \\[2em] \textrm{\textcolor{skyblue}{(b) 0x3B – 0x12}}\qquad\qquad&\\[1em] 3B&\\ -12&\\ \text{\textcolor{khaki}{ $\overline{29}$}}&\\[1em] \end{aligned}
  1. Fill in a truth table for the following functions. Show all steps.
    (a) x + (y & ~z) xor y
    Mathematical Notation: x(y z)yx \lor (y \wedge ~z) \oplus y
x y z ¬z\neg z y¬zy \wedge \neg z x(y¬z)x \lor (y \wedge \neg z) ...y... \oplus y
1 1 1 0 0 1 0
1 1 0 1 1 1 0
1 0 1 0 0 1 1
1 0 0 1 0 1 1
0 1 1 0 0 0 1
0 1 0 1 1 1 0
0 0 1 0 0 0 0
0 0 0 1 0 1 1

(b) (x + y) & ~z xor y
Mathematical Notation: (xy)¬zy(x \lor y) \wedge \neg z \oplus y

x y z ¬z\neg z xyx \lor y (xy)¬z(x\lor y)\wedge \neg z ...y... \oplus y
1 1 1 0 1 0 1
1 1 0 1 1 1 0
1 0 1 0 1 0 0
1 0 0 1 1 1 1
0 1 1 0 1 0 0
0 1 0 1 1 1 0
0 0 1 0 0 0 0
0 0 0 1 0 0 0